package com.example.product_practices.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "groups")
public class Groups {
    private static final long serialVersionUID = 1L;
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String name;
    private Integer userId;
    private String description;
    private Integer status;
    private Integer used;

    public Groups(Groups groups) {
        if (Objects.nonNull(groups)) {
            this.id = groups.id;
            this.name = groups.name;
            this.userId = groups.userId;
            this.description = groups.description;
            this.status = groups.status;
            this.used = groups.used;
        }
    }
}
